<template>
  <dt-modal-edit ref='edit' :title='title' :loading="loading" :label-width='100' okText='确认'
    :width='800' @ok='onOk'>
    <div slot="bottom">
      <p class="title">审批流程</p>
      <!-- <dt-grid ref="table" :columns="columns" :list='list' height-resize /> -->
      <dt-grid ref="table" :onFetch='onFetch' :height='400' />
    </div>
  </dt-modal-edit>
</template>

<script>
  import editOpt from '../opt/auditOpt.js'
  import Column from '../opt/processColumns.js'
  import companyApi from '@/biz/backStage/companyCard'

  export default {
    data() {
      return {
        info: {},
        columns: [],
        list: [],
        title: '审批',
        loading: false
      }
    },
    mounted() {},
    methods: {
      show(info) {
        this.info = {
          ...info,
          auditResultFlag: '',
          auditReason: '',
        }
        this.$refs.edit.show(editOpt.options(this), this.info)
        this.$refs.table.init(this, new Column(this))
        this.$refs.table.fetch()
      },
      hide() {
        this.$refs.edit.hide()
      },
      onFetch() {
        return companyApi.getProcess()
      },
      update() {
        console.log(22222)
        this.$refs.edit.update(editOpt.options(this), this.info)
      },
      onOk(data) {
        console.log(this.info.auditType)
        this.loading = true
      },
    },
  }
</script>

<style lang="scss" scoped>
  .title {
    line-height: 20px;
    border-left: 3px solid #2b85e4;
    padding-left: 8px;
    margin-bottom: 10px;
  }
</style>